# Maintainer: Konstantin Gizdov <arch at kge dot pw>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>
# Contributor: mortzu

pkgname=ipv6calc
pkgver=4.1.0
pkgrel=1
pkgdesc='Small utility to manipulate, convert and calculate (more than) IPv6 addresses'
url='https://www.deepspace6.net/projects/ipv6calc.html'
license=('GPL2')
arch=('loong64' 'x86_64')
optdepends=('perl: to run the provided scripts')
checkdepends=('perl-digest-sha1' 'perl-uri' 'perl-html-parser' 'perl-proc-processtable')
source=("https://www.bieringer.de/ftp/pub/linux/IPv6/ipv6calc/${pkgname}-${pkgver}.tar.gz"{,.asc}
        'anti-dos_test.patch')
b2sums=('6519af3ba2b7f714b024c81d99023d38c1e4b49a942be716ce86659fe3f550ef3775bae3a3979a99fe5f2021c29470d6e292478df2a8353ed7a8d8523084dc69'
        'SKIP'
        '611bbcb7e7babeaf6ace8888230aa15ab5744fd228ec717ee7ff11f1be3dfe03944896ceab07dc36426a3e8c3daaea51c47ed06fc54b7c710cd3ea694f04696e')
validpgpkeys=('AAB38CB797C750C778C608C6DDEB141DF7380F61') # Peter Bieringer (Code Signing Key 2013) <code@bieringer.de>

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i "${srcdir}/anti-dos_test.patch"

  autoconf
}

build() {
  cd "${pkgname}-${pkgver}"

  ./configure \
    --prefix="/usr" \
    --libdir="/usr/lib" \
    --datarootdir="/usr/share" \
    --enable-shared \
    --enable-bundled-md5
  make
}

check() {
  cd "${pkgname}-${pkgver}"

  make test-minimal
}

package() {
  cd "${pkgname}-${pkgver}"

  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
